<?php
namespace AuctionCore\Other;
use Think\Exception;

/**
* 地址类功能 单元测试
* @author       Eric Lee
*/
class AddressTest extends \PHPUnit_Framework_TestCase
{

    //获得某级别地址信息      
    public function testGetByLevel(){  
        $add = new Address();
        $info = $add->get_by_level(0);
        $this->assertTrue(count($info)>0);
    }

    //获得子级别地址信息
    public function testGetByPd(){        
        $add = new Address();
        $info = $add->get_by_pd(110000);
        $this->assertTrue(count($info)>0);
    }

    //获得地址code
    public function testGetCodeByName(){        
        $add = new Address();
        $code = $add->get_code_by_name('北京');
        $this->assertTrue(intval($code)>0);
    }
}

?>